#!/bin/sh
#Barry Kauler 2011, GPL3 (/usr/share/doc/legal)
#specified in /etc/sudoers or /etc/sudo.conf, gui-helper for sudo. (path compiled-in to my sudo PET)

export TEXTDOMAIN=askpass
export OUTPUT_CHARSET=UTF-8

INSERTMSG="$(gettext 'Enter the administrator password:')"

if [ $DISPLAY ];then
 ADMINPASSWORD=$(/usr/lib/gtkdialog/box_passwd "root" "$INSERTMSG")
else
 echo >/dev/console
 echo -n "$INSERTMSG " >/dev/console
 read -t 30 ADMINPASSWORD
 [ "$ADMINPASSWORD" = "" ] && echo '...failed' >/dev/console
fi

echo "$ADMINPASSWORD" #return password to sudo.

### END ###
